# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: Exp $

inherit eutils

DESCRIPTION="Fritzing is an open-source initiative to support designers, artists, researchers and hobbyists to take the step from physical prototyping to actual product."
SRC_URI="http://fritzing.org/download/0.2.5b/source-tarball/fritzing.2009.04.02.source.tar.bz2"
HOMEPAGE="http://fritzing.org"

IUSE=""
SLOT="0"
LICENSE="GPL-3"
KEYWORDS="~x86 ~amd64 ~ppc ~ia64"

DEPEND="x11-libs/qt-core"

S="${WORKDIR}/fritzing.2009.04.02.source"

src_unpack() {
    unpack ${A}
    cd ${S}
}

src_compile() {
    qmake -unix || die "qmake failed."
    emake || die "emake failed"
}

src_install () {
	mkdir -p "${D}/usr/share/${P}/" "${D}/usr/bin" "${D}/usr/share/applications/"
	cd "${S}"
	cp "${FILESDIR}"/Fritzing.desktop "${D}/usr/share/applications/"
	rm -Rf phoenix.pro phoenix.pro Makefile.Release Makefile.Debug Makefile src tools release
	cp -a * "${D}/usr/share/${P}"
	dosym "/usr/share/${P}/Fritzing" /usr/bin/Fritzing 
}